package com.htzg.jardemo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.web.servlet.ServletComponentScan;

/**
 * @author zgb
 */

//自动扫描并注册带有@ConfigurationProperties注解的类作为SpringBean
@ConfigurationPropertiesScan("com.htzg.jardemo")
//在SpringBootApplication上使用@ServletComponentScan注解后:Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册，无需其他代码
//@ServletComponentScan(basePackages = {"com.audaque.springboot.foshanupload"})//servlet扫描
@ServletComponentScan

//@SpringBootApplication里面有@ComponentScan：告诉Spring从哪里找到bean，包扫描会扫描只要标注了@Controller,@Service,@Repository,@Component这四个注解都会被扫描到容器中。

//如果项目不需要数据库相关信息就排除此类的autoconfig
//@SpringBootApplication可以运行war
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
//把启动类放到同级下或让所有Java类都在启动类的子包下就可以完成基于Java注入bean的方式了
//@SpringBootApplication(scanBasePackages = "com.audaque.springboot.foshanupload.web.demo.controller")
//@SpringBootApplication
public class JarDemoWebJarApplication {

    public static void main(String[] args) {
        SpringApplication.run(JarDemoWebJarApplication.class, args).registerShutdownHook();

    }
}

